﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using _4T.Data;
using _4T.DAL;
using _4T.Data.IDataContext;

namespace _4T.BLL
{
    public class ConsiderAndDecideBLL
    {
        private ICMSConsiderAndDecide _View;
        private ConsiderAndDecideDAL repository;

        public ConsiderAndDecideBLL() { repository = new ConsiderAndDecideDAL(); }
        public ConsiderAndDecideBLL(ICMSConsiderAndDecide view)
        {
            _View = view;
            repository = new ConsiderAndDecideDAL();
        }

        ~ConsiderAndDecideBLL()
        {
            repository = null;
        }

        public int AddConsiderAndDecide()
        {
            return repository.AddConsiderAndDecide(_View.ConsiderAndDecideID, _View.ConsiderAndDecideName, _View.DiseaseName,
                _View.PhaseOfDisease, _View.IsTreat, _View.IsRecover, _View.AnticipateSpend, _View.TreatTime, _View.CommentOfDoctor,
                _View.IsPoor, _View.IsDirectLabour, _View.CauseIll, _View.ImageUrl, _View.VideoUrl, _View.CommentOfConsider, _View.ProfileName, _View.CreatedDate);
        }

        public CMSConsiderAndDecide GetConsiderAndDecideByID(Guid considerAndDecideID)
        {
            return repository.GetConsiderAndDecideByID(considerAndDecideID);
        }

        public CMSConsiderAndDecide GetConsiderAndDecideByProfile(string profileName)
        {
            return repository.GetConsiderAndDecideByProfile(profileName);
        }

        public IEnumerable<CMSConsiderAndDecide> GetAllConsiderAndDecide()
        {
            return repository.GetAllConsiderAndDecide();
        }
        public IEnumerable<ProfileFilterCus> GetInfoFilterByProfileCode(string profileCode)
        {
            return repository.GetInfoFilterByProfileCode(profileCode);
        }

        public int DeleteCDWhenApprove(Guid considerAndDecideID)
        {
            return repository.DeleteCDWhenApprove(considerAndDecideID);
        }
    }
}